import Mock from '../mock-class.js'

const menus = [
	{
		id: 1,
		parentId: 0,
		name: 'home',
		title: '工作台',
		createTime: '2022-04-10 12:25:36',
		isParent: false,
		level: 1,
		children: [],
	},
	{
		id: 2,
		parentId: 0,
		name: 'system',
		title: '系统管理',
		createTime: '2022-04-10 12:25:36',
		isParent: true,
		level: 1,
		children: [
			{
				id: 3,
				parentId: 2,
				name: 'permission',
				title: '权限管理',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			},
			{
				id: 4,
				parentId: 2,
				name: 'role',
				title: '角色管理',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			},
			{
				id: 5,
				parentId: 2,
				name: 'user',
				title: '用户管理',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			},
			{
				id: 6,
				parentId: 2,
				name: 'permission',
				title: '权限动作',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			},
			{
				id: 20,
				parentId: 2,
				name: 'department',
				title: '部门管理',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			}
		],
	},
	{
		id: 7,
		parentId: 0,
		name: 'comp',
		title: '组件管理',
		createTime: '2022-04-10 12:25:36',
		isParent: true,
		level: 1,
		children: [
			{
				id: 13,
				parentId: 7,
				name: 'divider',
				title: 'Divider分割线',
				createTime: '2022-04-10 12:25:36',
				isParent: false,
				level: 2,
				children: [],
			},
			{
				id: 8,
				parentId: 7,
				name: 'feedback',
				title: '反馈组件',
				createTime: '2022-04-10 12:25:36',
				isParent: true,
				level: 2,
				children: [
					{
						id: 10,
						parentId: 8,
						name: 'drawer',
						title: 'Drawer抽屉',
						createTime: '2022-04-10 12:25:36',
						isParent: false,
						level: 3,
						children: [],
					}
				],
			},
			{
				id: 9,
				parentId: 7,
				name: 'form',
				title: '表单组件',
				createTime: '2022-04-10 12:25:36',
				isParent: true,
				level: 2,
				children: [
					{
						id: 11,
						parentId: 9,
						name: 'input',
						title: 'Input输入框',
						createTime: '2022-04-10 12:25:36',
						isParent: false,
						level: 3,
						children: [],
					},
					{
						id: 12,
						parentId: 9,
						name: 'rate',
						title: 'Rate评分',
						createTime: '2022-04-10 12:25:36',
						isParent: false,
						level: 3,
						children: [],
					}
				],
			},
		],
	}
]

Mock.mock(Mock.baseURL + '/menu/list', 'get', function (options) {
	// console.log(options)
	return {
		code: 200,
		data: {
			list: menus,
			total: 3
		},
		message: ''
	}
})